package com.demo.boss.common.convert;

import com.demo.boss.common.enums.PublicStatus;
import org.mapstruct.Named;
import org.springframework.stereotype.Component;

@Component
public class MapperHelper {
    @Named("translateStatus")
    public String translateStatus(String status){
        try {
            PublicStatus publicStatus = PublicStatus.valueOf(status);
            return publicStatus.getText();
        } catch (Exception e) {
           e.printStackTrace();
        }
        return "未知";
    }
    @Named("translateAutoSett")
    public String translateAutoSett(String AutoSett){
        if ("YES".equals(AutoSett)){
            return "是";
        }
        return "否";
    }
}
